<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  var obj = {
    name:"admin",
    age:18,
    sex:"男",
    hobby:["篮球","代码"]
  };

  // console.log(obj[0])
  // console.log(obj[1])
  // console.log(obj[2])
  // console.log(obj.length)

  // 专属语句for-in
  // for-in遍历到的是对象的键
  for(var i in obj){
    console.log( i );
    console.log( obj[i] );
  }


  console.log( obj )
  
</script>
</html>